<template>
    <div class="modal" v-if="visible" @click.stop>
        <el-card class="box-card" :style="{width: width, height: height}">
            <div slot="header" class="clearfix" style="padding: 10px;">
                <span>{{ title }}</span>
                <el-button @click="closePopup()" style="float: right; padding: 3px 0" type="text">关闭</el-button>
            </div>
            <div class="searchbar" style="padding: 0 10px;">
                <el-row :gutter="20">
                    <el-col :span="24" class="label-el-col">
                        <span class="placeholder-span">请输入：{{verifyText}}</span>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="16" :offset="4">
                        <el-input size="mini" placeholder="" v-model="verifyInput" class="input-verify"></el-input>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="24" class="label-el-col">
                        <pers-button perms="live:list:screen:off:end_live" size="small" @click="closePopup" label="取 消">取 消</pers-button>
                        <pers-button perms="live:list:screen:on:end_live" size="small" type="danger" @click="clickVerify" label="确 定"></pers-button>
                    </el-col>
                </el-row>
            </div>
        </el-card>
        

    </div>
</template>

<script>
import Panle from '@/components/Panle.vue'
import PersButton from '@/components/PersButton.vue'
import SelectImg from '@/components/select-img.vue'

export default {
    name: 'pay-frame',
    props: {
        visible: {
            type: Boolean,
            default: false
        },
        title: {
            type: String,
            default: ''
        },
        width: {
            type: String,
            default: '30%'
        },
        height: {
            type: String,
            default: '30%'
        },
        liveId: {
            type: String,
            default: null
        }
    },
    components:{
        Panle,
        PersButton,
        SelectImg
    },
    data(){
        return{
            loading:false,
            verifyText: '确认结束',
            verifyInput: null,
        }
    },
    created() {
        
    },
    mounted() {
        
    },
    methods:{
        // 关闭弹窗
        closePopup() {
            this.$emit('close');
            this.verifyInput = null;
        },
        // 内部关闭
        closeStatus() {
            if (this.visible === true) {
                this.visible = false;
            }
        },
        clickVerify() {
            if (this.verifyText !== this.verifyInput) {
                this.$message.error('请输入：确认结束');
                return;
            }
            this.$emit('submit');
            this.closePopup();
        },
    },
    beforeDestroy() {
        // document.removeEventListener('click', this.closeStatus);
    }
}
</script>

<style lang="scss" scoped>
@import "@/assets/css/common";
/* 样式代码 */
.modal {
    /* 弹窗样式 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 555;
}
.modal-content {
    /* 弹窗内容样式 */
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
}
.label-el-col {
    text-align: center;
}
.text {
    font-size: 14px;
}
.item {
    margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
    display: table;
    content: "";
}
.clearfix:after {
    clear: both
}
.box-card {
    width: 80%;
    height: 80%;
}
.el-select .el-input {
     width: 80px;
 }
.searchbar .placeholder-span {
    font-size: 14px;
    color: #6E6E6E;
    line-height: 40px;
}
.searchbar .input-verify {
    background-color: #fff;
    line-height: 50px;
    text-align: center;
}
.searchbar .button-verify {
    line-height: 10px;
    padding: 0 20px;
}
.searchbar .button-verify-submit {
    color: white;
    padding: 0 20px;
}
</style>
